package pers.liyan.shi.providerticket.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import pers.liyan.shi.providerticket.config.ServerConfig;
import pers.liyan.shi.providerticket.service.TicketService;

@RestController
public class TicketController {

    @Autowired
    private ServerConfig serverConfig;

    @Autowired
    private TicketService service;

    @GetMapping("/ticket")
    public String getTicket(){
        System.out.println("PORT: " + serverConfig.getPort());
        return service.getTicket();
    }

}
